/* ====================================================================
 * The UncleGED Open Source Software License
 *
 * Copyright (c) 1999-2003 D. M. DeBacker. All rights reserved.
 * http://gatheringleaves.org/uged
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. Products derived from this software may not be called "UncleGED",
 *    nor may "UncleGED" appear in their name, without prior written
 *    permission of D. M. DeBacker.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL D. M. DEBACKER BE LIABLE FOR ANY 
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 */

using System.Xml.Serialization;
using System.IO;

namespace UGed
{
	public class UgedApplicationSettings 
	{

		public UgedApplicationSettings() 
		{
			string  sPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

			//set the defaults
			mvarPrivacy = true;
			mvarAuthorsEmail = "";
			mvarAuthorsName = "";
			mvarAddUserCopyright = false;
			mvarDisplayMRIN = true;
			mvarDisplayRIN = true;
			mvarAuthorsUrl = "";
			mvarCreateGendexFile = false;
			mvarMainPageTitle = "My Family";
			mvarUseBackground = true;
			mvarUseBanner = true;
			mvarBackgroundFile = "images/ug_bkgrd.gif";
			mvarBannerFile = "images/ug_banner.gif";
			mvarExcludeNotes = false;
			mvarAddKeywords = true;
			mvarWarnNonAnsi = false;
			mvarAddSurnameCount = true;
			mvarCreateListReport = true;
			mvarCreateStatsPage = true;
			mvarCreateChronoPage = true;
			mvarChronoCutOff = 1900;
			mvarFamFilePrefix = "fam";
			mvarChronoLinks = true;
			mvarSurnamesAllCaps = true;
			mvarMostRecentOnIndex = true;
			mvarMostRecentOnPage = true;
			mvarHiLiteMostRecent = true;
			mvarCreateLocPage = true;
			mvarLocDisplayEventDates = false;
			mvarLocEstimateMethod = 1;
			mvarLocReverseOrder = true;
			mvarIgnoreOccupations = true;
			mvarCreateOccupationsPage = true;
			mvarOccLocEqualsOccText = false;
			mvarHtmlPath = sPath + "\\html";
			mvarGedcomPath = sPath + "\\gedcom\\ASmallGed.ged";
			//added in 6.2
			mvarDoDateEstimation = false;
			mvarBirthCutOffYears = 80;
			mvarExcludeLivingIndividualsAfterBirthCutOff = false;
			//added in 6.4
			mvarFtpRemoteServer = "";
			mvarFtpRemoteDirectory = "";
			mvarFtpUserName = "";
			mvarFtpPassword = "";
			mvarFtpSavePassword = false;
			mvarUseCSS = false;

		}

		private bool mvarPrivacy;
		private bool mvarUseBackground;
		private bool mvarUseBanner;
		private short mvarWriteOption;
		private bool mvarExcludeNotes;
		private string  mvarFileSource;
		private bool mvarTabDelimit;
		private bool mvarAddKeywords;
		private bool mvarAddSurnameCount;
		private bool mvarCreateListReport;
		private bool mvarCreateStatsPage;
		private string  mvarAuthorsName;
		private string  mvarAuthorsEmail;
		private bool mvarDisplayRIN;
		private bool mvarDisplayMRIN;
		private bool mvarAddUserCopyright;
		private string  mvarAuthorsUrl;
		private bool mvarCreateGendexFile;
		private bool mvarWarnNonAnsi;
		private bool mvarCreateChronoPage;
		private short mvarChronoCutOff;
		private bool mvarChronoLinks;
		private bool mvarSurnamesAllCaps;
		private bool mvarMostRecentOnPage;
		private bool mvarMostRecentOnIndex;
		private bool mvarHiLiteMostRecent;
		private bool mvarCreateLocPage;
		private bool mvarLocReverseOrder;
		private short mvarLocEstimateMethod;
		private bool mvarLocDisplayEventDates;
		private bool mvarIgnoreOccupations;
		private bool mvarCreateOccupationsPage;
		private bool mvarOccLocEqualsOccText;
		private string  mvarBackgroundFile;
		private string  mvarBannerFile;
		private string  mvarGedcomPath;
		private string  mvarHtmlPath;
		private string  mvarMainPageTitle;
		private string  mvarFamFilePrefix;

		//added in 6.2
		private bool mvarDoDateEstimation;
		private short mvarBirthCutOffYears;
		private bool mvarExcludeLivingIndividualsAfterBirthCutOff;

		//added in 6.4
		private string  mvarFtpRemoteServer;
		private string  mvarFtpRemoteDirectory;
		private string  mvarFtpUserName;
		private string  mvarFtpPassword;
		private bool mvarFtpSavePassword;
		private bool mvarUseCSS;

		public bool UseCSS  
		{
			get 
			{
				return mvarUseCSS;
			}
			set 
			{
				mvarUseCSS = value;
			}
		}


		public string  FtpRemoteServer  
		{
			get 
			{
				return mvarFtpRemoteServer;
			}
			set 
			{
				mvarFtpRemoteServer = value;
			}
		}

		public string  FtpRemoteDirectory  
		{
			get 
			{
				return mvarFtpRemoteDirectory;
			}
			set 
			{
				mvarFtpRemoteDirectory = value;
			}
		}

		public string  FtpUserName  
		{
			get 
			{
				return mvarFtpUserName;
			}
			set 
			{
				mvarFtpUserName = value;
			}
		}

		public string  FtpPassword  
		{
			get 
			{
				return mvarFtpPassword;
			}
			set 
			{
				mvarFtpPassword = value;
			}
		}

		public bool FtpSavePassword  
		{
			get 
			{
				return mvarFtpSavePassword;
			}
			set 
			{
				mvarFtpSavePassword = value;
			}
		}

		public bool ExcludeLivingIndividualsAfterBirthCutOff  
		{
			get 
			{
				return mvarExcludeLivingIndividualsAfterBirthCutOff;
			}
			set 
			{
				mvarExcludeLivingIndividualsAfterBirthCutOff = value;
			}
		}

		public short BirthCutOffYears  
		{
			get 
			{
				return mvarBirthCutOffYears;
			}
			set 
			{
				mvarBirthCutOffYears = value;
			}
		}

		public bool DoDateEstimation  
		{
			get 
			{
				return mvarDoDateEstimation;
			}
			set 
			{
				mvarDoDateEstimation = value;
			}
		}

		public string  FamFilePrefix  
		{
			get 
			{
				return mvarFamFilePrefix;
			}
			set 
			{
				mvarFamFilePrefix = value;
			}
		}

		public string  MainPageTitle  
		{
			get 
			{
				return mvarMainPageTitle;
			}
			set 
			{
				mvarMainPageTitle = value;
			}
		}

		public string  HtmlPath  
		{
			get 
			{
				return mvarHtmlPath;
			}
			set 
			{
				mvarHtmlPath = value;
			}
		}

		public string  GedcomPath  
		{
			get 
			{
				return mvarGedcomPath;
			}
			set 
			{
				mvarGedcomPath = value;
			}
		}


		public string  BannerFile  
		{
			get 
			{
				return mvarBannerFile;
			}
			set 
			{
				mvarBannerFile = value;
			}
		}

		public string  BackgroundFile  
		{
			get 
			{
				return mvarBackgroundFile;
			}
			set 
			{
				mvarBackgroundFile = value;
			}
		}


		public bool OccLocEqualsOccText  
		{
			get 
			{
				return mvarOccLocEqualsOccText;
			}
			set 
			{
				mvarOccLocEqualsOccText = value;
			}
		}

		public bool CreateOccupationsPage  
		{
			get 
			{
				return mvarCreateOccupationsPage;
			}
			set 
			{
				mvarCreateOccupationsPage = value;
			}
		}


		public bool IgnoreOccupations  
		{
			get 
			{
				return mvarIgnoreOccupations;
			}
			set 
			{
				mvarIgnoreOccupations = value;
			}
		}


		public bool LocDisplayEventDates  
		{
			get 
			{
				return mvarLocDisplayEventDates;
			}
			set 
			{
				mvarLocDisplayEventDates = value;
			}
		}


		public short LocEstimateMethod  
		{
			get 
			{
				return mvarLocEstimateMethod;
			}
			set 
			{
				mvarLocEstimateMethod = value;
			}
		}


		public bool LocReverseOrder  
		{
			get 
			{
				return mvarLocReverseOrder;
			}
			set 
			{
				mvarLocReverseOrder = value;
			}
		}


		public bool CreateLocPage  
		{
			get 
			{
				return mvarCreateLocPage;
			}
			set 
			{
				mvarCreateLocPage = value;
			}
		}


		public bool HiLiteMostRecent  
		{
			get 
			{
				return mvarHiLiteMostRecent;
			}
			set 
			{
				mvarHiLiteMostRecent = value;
			}
		}


		public bool MostRecentOnIndex  
		{
			get 
			{
				return  mvarMostRecentOnIndex;
			}
			set 
			{
				mvarMostRecentOnIndex = value;
			}
		}


		public bool MostRecentOnPage  
		{
			get 
			{
				return mvarMostRecentOnPage;
			}
			set 
			{
				mvarMostRecentOnPage = value;
			}
		}


		public bool SurnamesAllCaps  
		{
			get 
			{
				return mvarSurnamesAllCaps;
			}
			set 
			{
				mvarSurnamesAllCaps = value;
			}
		}


		public bool ChronoLinks  
		{
			get 
			{
				return mvarChronoLinks;
			}
			set 
			{
				mvarChronoLinks = value;
			}
		}


		public short ChronoCutOff  
		{
			get 
			{
				return mvarChronoCutOff;
			}
			set 
			{
				mvarChronoCutOff = value;
			}
		}


		public bool CreateChronoPage  
		{
			get 
			{
				return  mvarCreateChronoPage;
			}
			set 
			{
				mvarCreateChronoPage = value;
			}
		}


		public bool WarnNonAnsi  
		{
			get 
			{
				return  mvarWarnNonAnsi;
			}
			set 
			{
				mvarWarnNonAnsi = value;
			}
		}



		public bool CreateGendexFile  
		{
			get 
			{
				return  mvarCreateGendexFile;
			}
			set 
			{
				mvarCreateGendexFile = value;
			}
		}



		public string  AuthorsUrl  
		{
			get 
			{
				return  mvarAuthorsUrl;
			}
			set 
			{
				mvarAuthorsUrl = value;
			}
		}


		public bool AddUserCopyright  
		{
			get 
			{
				return  mvarAddUserCopyright;
			}
			set 
			{
				mvarAddUserCopyright = value;
			}
		}



		public bool DisplayMRIN  
		{
			get 
			{
				return  mvarDisplayMRIN;
			}
			set 
			{
				mvarDisplayMRIN = value;
			}
		}


		public bool DisplayRIN  
		{
			get 
			{
				return  mvarDisplayRIN;
			}
			set 
			{
				mvarDisplayRIN = value;
			}
		}


		public string  AuthorsEmail  
		{
			get 
			{
				return  mvarAuthorsEmail;
			}
			set 
			{
				mvarAuthorsEmail = value;
			}
		}


		public string  AuthorsName  
		{
			get 
			{
				return  mvarAuthorsName;
			}
			set 
			{
				mvarAuthorsName = value;
			}
		}


		public bool CreateStatsPage  
		{
			get 
			{
				return  mvarCreateStatsPage;
			}
			set 
			{
				mvarCreateStatsPage = value;
			}
		}


		public bool CreateListReport  
		{
			get 
			{
				return  mvarCreateListReport;
			}
			set 
			{
				mvarCreateListReport = value;
			}
		}


		public bool AddSurnameCount  
		{
			get 
			{
				return mvarAddSurnameCount;
			}
			set 
			{
				mvarAddSurnameCount = value;
			}
		}


		public bool AddKeywords  
		{
			get 
			{
				return  mvarAddKeywords;
			}
			set 
			{
				mvarAddKeywords = value;
			}
		}


		public bool TabDelimit  
		{
			get 
			{
				return  mvarTabDelimit;
			}
			set 
			{
				mvarTabDelimit = value;
			}
		}


		public string  FileSource  
		{
			get 
			{
				return  mvarFileSource;
			}
			set 
			{
				mvarFileSource = value;
			}
		}


		public bool ExcludeNotes  
		{
			get 
			{
				return  mvarExcludeNotes;
			}
			set 
			{
				mvarExcludeNotes = value;
			}
		}

		public short WriteOption  
		{
			get 
			{
				return  mvarWriteOption;
			}
			set 
			{
				mvarWriteOption = value;
			}
		}


		public bool UseBanner  
		{
			get 
			{
				return  mvarUseBanner;
			}
			set 
			{
				mvarUseBanner = value;
			}
		}


		public bool UseBackground  
		{
			get 
			{
				return  mvarUseBackground;
			}
			set 
			{
				mvarUseBackground = value;
			}
		}


		public bool Privacy  
		{
			get 
			{
				return  mvarPrivacy;
			}
			set 
			{
				mvarPrivacy = value;
			}
		}
	}


	public class LocalApplication 
	{
		private int mvarFirstFamily;
		private bool mvarWriteXML;

		public bool WriteXML
		{
			get 
			{
				return mvarWriteXML;
			}
			set 
			{
				mvarWriteXML = value;
			}
		}


		public int FirstFamily  
		{
			get 
			{
				return mvarFirstFamily;
			}
			set 
			{
				mvarFirstFamily = value;
			}
		}

	}
}